project: | Jax Newsletter (program for running a mailinglist) | |||||||||
file: | jax_newsletter.php | |||||||||
version: | 1.02 (optional database support) | |||||||||
interpreter: | PHP 4.02+ | |||||||||
code: | Andreas John | |||||||||
design: | Andreas John | |||||||||
homepage: | www.jtr.de/scripting/php/newsletter | |||||||||
license: |
Copyright (C) 2001, Andreas John (Jack (tR)) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. A copy of this license you can find in the added text file gpl.txt or on the website of the Free Software Foundation under: |
|||||||||
credits: |
I want to say a Big Thank You to all the people supporting this and other Open Source Projects by giving hints, translations and link it on their websites... Special thanx go to:
|
1. What's Jax Newsletter ? What do I need it for?
Jax Newsletter is a Script for running mailinglists directly on your website, to adminster and post e-mails to that lists.
Current features of Jax Newsletter:
The mailinglist scripts do the following:
1.
The start script is jax_newsletter.php and can be called with the following parameters:
Example:
http://..../jax_newsletter.php?ml_id=1&language=English
ml_id defines the mailinglist that is used.
If you set no parameter, ml_id is set to 0
If you set a parameter you have to fit globals.inc.php (as described
in --> Can Jax Newsletter handle several Newsletters?
)
language tells the script which language template to use. If you set the parameter make sure the template file exists in the directory language.
jax_newsletter.php leads the visitor onto two input forms where he can sign in (sign_in.php) or sign out (sign_out.php).
2.
If the visitor signs in or out the mailinglist his input data are stored in a log file (records by default). Additionally a key is generated by random (pseudo-random) and is saved together with the e-mail-address in the file subscriberlist.
To avoid that someone signs in or out an other one's e-mail-adress, the script (sign.php) sends a confirmation e-mail to the "owner" of the e-mail-address. That e-mail contains a hyperlink to the script verify.php. The recipient only have to click it to sign in or sign out:
Example:
http://.../newsletter/verify.php?language=German&ml_id=0&do=sign&uid=3406044545....
do tells the script whether the visitor signs in or out.
uid contains the key created by sign.php. Now verify.php compares the key in the link with the key in the file subscriberlist. Are they equal, the coresponding entry in the file subscriberlist goes deleted and the e-mail-address is transfered to the mailinglist (mailinglist), or deleted...
3.
If you want to delete a recipient from mailinglist manually you can use the script list.admin.php in the direcotry admin. To use it call the script index.php in the same directory!
Example:
http://..../admin/index.php?language=German
4.
To send a message to the mailinglist call the script posting.php (or use index.php). Enter subject and message and press send button.
Important:
To enable the script to send all messages you have to keep browser connection open. You may not close the browser window or press break button before you get a confirmation that all e-mails have been send!
2. How to install Jax Newsletter on my website?
Jax Newsletter was written in PHP 4. It requires PHP - a server side scripting language that enables you to design websites with dynamical generated content! (If you did not already - ask your provider for PHP support!)
You don't need database support to run Jax Newsletter!
If you have PHP support on your website do the following:
3. How to use Jax Newsletter with MySQL?
Jax Newsletter can use CSV textfiles or MySQL database tables for saving the Newsletter entries. Using MySQL gives you a better performance if you have a large mailinlists...
If you have MySQL support do the following:
CREATE TABLE mailinglist ( id int(16) NOT NULL auto_increment, username varchar(64) NOT NULL default '', domain varchar(64) NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM; CREATE TABLE records ( id int(16) NOT NULL auto_increment, action char(1) NOT NULL default '', time datetime NOT NULL default '0000-00-00 00:00:00', ip varchar(11) NOT NULL default '', email varchar(128) NOT NULL default '', profession varchar(128) NOT NULL default '', age year(4) NOT NULL default '0000', nationality varchar(64) NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM; CREATE TABLE subscriberlist ( id int(16) NOT NULL auto_increment, date date NOT NULL default '0000-00-00', hash varchar(32) NOT NULL default '', email varchar(128) NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM;
4. How many entries Jax Newsletter can handle?
I tested the script with a realistic amount of entries (about 1500 in CSV-file) and it did it's job. Theoretically (depending on your webserver's space and power) it should be able to handle a larger amount of a few thousands of entries. If you have a big mailing list, using MySQL data source is the better way...
5. Can Jax Newsletter handle several Newsletters?
No problem! :-)
If you want to handle mor than one Newsletter on your homepage there are two
ways to accomplish it:
Either:
You put the script in seperate directorys (one for each mailig list). But this can become hard to handle the more lists you run.
Or:
You call the script using the parameter ml_id e.g:
http://../jax_newsletter.php?ml_id=1
For security reasons the name of the Newsletter file can not be forwarded with the URL.
The allocation of the Mailinglist IDs and the Newsletters you have (currently) to put manually in the file globals.inc.php:
...
// Titel des Newsletters
$newsletters[0]->title = "Jax Newsletter (English)";
$newsletters[0]->data_source = "csvfile";// CSS template for the Newsletter
$newsletters[0]->css = "styles/default.css";
$newsletters[0]->do_log = true;
$newsletters[0]->logfile = "records";
$newsletters[0]->subscriberlist = "subscriberlist";
$newsletters[0]->mailinglist = "mailinglist";
$newsletters[0]->db_server = "";
$newsletters[0]->db_login = "";
$newsletters[0]->db_database = "";
$newsletters[0]->db_password = "";$newsletters[1]->title = "Jax Newsletter (German)";
$newsletters[1]->data_source = "mysql";
$newsletters[1]->css = "styles/default.css";
$newsletters[1]->do_log = true;
$newsletters[1]->logfile = "records";
$newsletters[1]->subscriberlist = "subscriberlist";
$newsletters[1]->mailinglist = "mailinglist";
$newsletters[1]->db_server = "mysql4.webpack.hosteurope.de";
$newsletters[1]->db_login = "ftp19999";
$newsletters[1]->db_database = "mailinglist";
$newsletters[1]->db_password = "banane";...
The example shows how to run a second Newsletter with the same script:
The second list uses a mysql-database server. It will be used by the URL http://../jax_newsletter.php?ml_id=1
and corresponding the URL http://../jax_newsletter?ml_id=2 used a third mailinglist and so on...
You can freely choose the data source (mysql/csvfile) for each Newsletter!
- If the connection to the browser breaks during sending to mailinglist (e.g. if Proxy times out), not all recipients will get a message. Additionally it sending can take a lot of time if you send to big mailinglists.
Im working on alternatives! :-)
If you find any error or if you have proposals for improvement, please don't hesistate to contact me directly:
Berlin, 30.12.2001 Jack (tR)